import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 精力tab列表
export function tabList(params) {
  return request({
    url: '/admin/energy/tab',
    method: 'get',
    params
  });
}
// 精力列表
export function energyList(params, cancelToken) {
  return request({
    url: '/admin/energy/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 新建精力分配
export function energyCreate(data) {
  return request({
    url: '/admin/energy/create',
    method: 'post',
    data
  });
}
// 新建精力分配
export function energyEdit(id, data) {
  return request({
    url: `/admin/energy/edit/${id}`,
    method: 'put',
    data
  });
}
// 删除精力列表元素
export function deleteEneegy(id) {
  return request({
    url: `/admin/energy/delete/${id}`,
    method: 'delete'
  });
}
// 获取精力详情信息
export function energyInfo(id) {
  return request({
    url: `admin/energy/detail/info/${id}`,
    method: 'get'
  });
}
// 是否可编辑精力分配表
export function getAddEditPermission(id) {
  return request({
    url: `admin/energy/detail/addEditPermission/${id}`,
    method: 'get'
  });
}
// 供应商结算评论列表
export function getEnergyComments(params) {
  return request({
    url: '/admin/energy/comments/list',
    method: 'get',
    params
  });
}
// 供应商结算发表评论
export function energyCommentAdd(data) {
  return request({
    url: '/admin/energy/comments/add',
    method: 'post',
    data
  });
}
// 获取精力详情列表
export function energyDetailList(params) {
  return request({
    url: 'admin/energy/detail/list',
    method: 'get',
    params
  });
}
// 填充上次
export function getEnergyLastData(params) {
  return request({
    url: 'admin/energy/detail/lastData',
    method: 'get',
    params
  });
}
// 精力分配编辑提交
export function storeEnergyDetailList(data) {
  return request({
    url: 'admin/energy/detail/list/store',
    method: 'post',
    data
  });
}
// 未填写人员通知
export function sendReminder(data) {
  return request({
    url: 'admin/energy/detail/reminderSend',
    method: 'post',
    data
  });
}
// 精力分配-流程审批
export function energyProcessAudit(data) {
  return request({
    url: '/admin/energy/process/audit',
    method: 'post',
    data
  });
}
// 精力分配 - 流程 - 撤回
export function energyProcessRecall(data) {
  return request({
    url: '/admin/energy/process/recall',
    method: 'post',
    data
  });
}
// 精力分配 - 流程 - 撤销
export function energyProcessRevocation(data) {
  return request({
    url: '/admin/energy/process/revocation',
    method: 'post',
    data
  });
}
// 表单提交、获取审批流
export function formSubmit(data) {
  return request({
    url: '/admin/energy/formSubmit',
    method: 'post',
    data
  });
}
// 获取最新的流程id，生成新的URL
export function getUrlInfo(params) {
  return request({
    url: 'admin/processManagement/url/info',
    method: 'get',
    params
  });
}
// 精力分配-获取精力类型
export function getEnergyTypeList() {
  return request({
    url: '/admin/energy/energyTypeList',
    method: 'get'
  });
}
// 精力分配-获取项目类型
export function getProjectTypeList() {
  return request({
    url: '/admin/energy/projectTypeList',
    method: 'get'
  });
}
// 精力分配-获取项目订单列表
export function getProjectOrderList(params) {
  return request({
    url: '/admin/energy/projectOrder/list',
    method: 'get',
    params
  });
}
